The part of the included source code that is meant to be used is the class known as "MachineEnv", this class provides easy access to the most common Gestalt values that any programmer would need to know. The rest of the program is just a very quickly done demo on how this information could be used and interpreted, but the code is documented well enough that you could learn the basics of Macintosh programming. For those of you who want to just plug the class in and go, here is the class interface:
//a 0 (zero) returned by any of these functions means that there was a problem encountered,
//except for the ReturnVMon() function of course.
long ReturnSysVer (void);//returns a long value containing the current System version
long ReturnUpdateVer (void);//returns a long value containing the current
//update version for 7.5.3 and >
long ReturnMachineType (void);//returns a long value containing the current machine ID number
long ReturnProcessor (void);//returns a long value containing the current PPC processor
long ReturnRealMem (void);//returns a long value containg the current physical RAM in bytes
long ReturnLogicalMem (void);//returns a long value containg the current logical RAM in bytes
Boolean ReturnVMon (void);//returns a Boolean value set to true if VM is present, false if not
This particluar version of the actual program is PPC only, but if anyone wants to make the necssary changes to the included project/files to make a 68k version, they are welcome to, as long as you return the altered program to me, so I can make sure it acts the same as the original. I don't want a bunch of different Apps floating around all over the place, and then get a ton of e-mail saying "my" program does not work right.
*Disclaimer*
I am providing this source code for free to any Macintosh programmer. I provide no guarantees as to the proper functioning of this code on any computer. As such, if you use this code in anyway, I can’t not be held liable for any damages incurred because of said use.
The code contained in the files "machineEnvClass.h", and "machineEnvConstructor.cpp", herein after known as "The Class" may not be altered in any way (unless otherwise noted, and then only in the context noted). You may use The Class in your program, but if you find it does not meet all of your needs, you must not alter The Class in anyway. Instead you may sub-class from it and extend it in the sub-class to fit your needs.